/*
 * Copyright (C) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OHOS_SIM_CONSTANT_H
#define OHOS_SIM_CONSTANT_H

namespace OHOS {
namespace Telephony {
enum ControllerType {
    ICC_CONTROLLER_REQ_BASE = 0x16EFF0,
    ICC_CONTROLLER_REQ_NONE,
    ICC_CONTROLLER_REQ_SEND_RESPONSE
};

// mnc Length type
enum MncType {
    UNINITIALIZED_MNC = -1,
    UNKNOWN_MNC = 0,
};

enum MWIType {
    MSG_SIM_MWI = 0,
    MSG_SIM_CFI = 1,
    MSG_SIM_SPN = 2
};

enum StateMessage {
    MSG_SIM_OBTAIN_ICC_FILE_DONE = 100,
    MSG_ICC_REFRESH = 31,
    MSG_SIM_APP_READY = 1
};

enum CallForwardType {
    ICC_CALL_FORWARD_TYPE_DISABLED = 0,
    ICC_CALL_FORWARD_TYPE_ENABLED = 1,
    ICC_CALL_FORWARD_TYPE_UNKNOWN = -1
};

enum SimMessage {
    MSG_ID_DEFAULT = 0,
    MSG_SIM_OBTAIN_IMSI_DONE = 0x03,
    MSG_SIM_OBTAIN_ICCID_DONE,
    MSG_SIM_OBTAIN_MBI_DONE,
    MSG_SIM_OBTAIN_MBDN_DONE,
    MSG_SIM_OBTAIN_MWIS_DONE,
    MSG_SIM_OBTAIN_VOICE_MAIL_INDICATOR_CPHS_DONE,
    MSG_SIM_OBTAIN_AD_DONE, // Admin data
    MSG_SIM_OBTAIN_MSISDN_DONE,
    MSG_SIM_OBTAIN_CPHS_MAILBOX_DONE,
    MSG_SIM_OBTAIN_SPN_DONE,
    MSG_SIM_OBTAIN_LI_LANGUAGE_DONE,
    MSG_SIM_OBTAIN_PL_LANGUAGE_DONE,
    MSG_SIM_OBTAIN_SPDI_DONE,
    MSG_SIM_UPDATE_DONE,
    MSG_SIM_OBTAIN_PNN_DONE,
    MSG_SIM_OBTAIN_SST_DONE,
    MSG_SIM_OBTAIN_ALL_SMS_DONE,
    MSG_SIM_MARK_SMS_READ_DONE,
    MSG_SIM_SET_MBDN_DONE,
    MSG_SIM_SMS_ON_SIM,
    MSG_SIM_OBTAIN_SMS_DONE,
    MSG_SIM_OBTAIN_CFF_DONE,
    MSG_SIM_SET_CPHS_MAILBOX_DONE,
    MSG_SIM_OBTAIN_INFO_CPHS_DONE,
    MSG_SIM_SET_MSISDN_DONE,
    MSG_SIM_OBTAIN_CFIS_DONE,
    MSG_SIM_OBTAIN_CSP_CPHS_DONE,
    MSG_SIM_OBTAIN_GID1_DONE,
    MSG_SIM_OBTAIN_GID2_DONE,
    MSG_SIM_OBTAIN_PLMN_W_ACT_DONE,
    MSG_SIM_OBTAIN_OPLMN_W_ACT_DONE,
    MSG_SIM_OBTAIN_HPLMN_W_ACT_DONE,
    MSG_SIM_OBTAIN_EHPLMN_DONE,
    MSG_SIM_OBTAIN_FPLMN_DONE,
    MSG_SIM_OBTAIN_DEVICE_IDENTITY_DONE,
    MSG_SIM_OBTAIN_CDMA_SUBSCRIPTION_DONE,
    MSG_SIM_SMS_ON_RUIM,
    MSG_SIM_OBTAIN_OPL_DONE,
    MSG_SIM_OBTAIN_OPL5G_DONE,
    MSG_SIM_OBTAIN_IMPI_DONE,
    MSG_SIM_OBTAIN_CSIM_SPN_DONE,
    MSG_SIM_OBTAIN_IST_DONE,
    MSG_SIM_OBTAIN_SPN_CPHS_DONE,
    MSG_SIM_OBTAIN_SPN_SHORT_CPHS_DONE,
#ifdef CORE_SERVICE_SUPPORT_ESIM
    MSG_ESIM_OPEN_CHANNEL_DONE = 1000,
    MSG_ESIM_CLOSE_CHANNEL_DONE,
    MSG_ESIM_OBTAIN_EID_DONE,
    MSG_ESIM_OBTAIN_EUICC_CHALLENGE_DONE,
    MSG_ESIM_OBTAIN_EUICC_INFO2_DONE,
    MSG_ESIM_OBTAIN_EUICC_INFO_1_DONE,
    MSG_ESIM_OBTAIN_DEFAULT_SMDP_ADDRESS_DONE,
    MSG_ESIM_ESTABLISH_DEFAULT_SMDP_ADDRESS_DONE,
    MSG_ESIM_DELETE_PROFILE,
    MSG_ESIM_SWITCH_PROFILE,
    MSG_ESIM_DISABLE_PROFILE,
    MSG_ESIM_RESET_MEMORY,
    MSG_ESIM_REMOVE_NOTIFICATION,
    MSG_ESIM_REQUEST_ALL_PROFILES,
    MSG_ESIM_LIST_NOTIFICATION,
    MSG_ESIM_SET_NICK_NAME,
    MSG_ESIM_CANCEL_SESSION,
    MSG_ESIM_OBTAIN_SMDS_ADDRESS,
    MSG_ESIM_GET_PROFILE,
    MSG_ESIM_RETRIEVE_NOTIFICATION_DONE,
    MSG_ESIM_RETRIEVE_NOTIFICATION_LIST,
    MSG_ESIM_AUTHENTICATE_SERVER,
    MSG_ESIM_PREPARE_DOWNLOAD_DONE,
    MSG_ESIM_SEND_APUD_DATA,
    MSG_ESIM_LOAD_BOUND_PROFILE_PACKAGE,
    MSG_ESIM_REQUEST_RULES_AUTH_TABLE,
    MSG_ESIM_CLOSE_SPARE_CHANNEL_DONE,
    MSG_ESIM_GET_CONTRACT_INFO_DONE,
#endif
};

enum ElementaryFile {
    // ETSI TS 102 221 V3.3.0 section 13.3 Preferred Languages
    ELEMENTARY_FILE_PL = 0x2F05,
    // CPHS V4.2 section B.3.1.1, B.4.1 - B.4.7 CPHS information Call forwarding flags and so on
    ELEMENTARY_FILE_VOICE_MAIL_INDICATOR_CPHS = 0x6F11,
    ELEMENTARY_FILE_CFF_CPHS = 0x6F13,
    ELEMENTARY_FILE_SPN_CPHS = 0x6F14,
    ELEMENTARY_FILE_CSP_CPHS = 0x6F15,
    ELEMENTARY_FILE_INFO_CPHS = 0x6F16,
    ELEMENTARY_FILE_MAILBOX_CPHS = 0x6F17,
    ELEMENTARY_FILE_SPN_SHORT_CPHS = 0x6F18,
    // 3GPP TS 51.011 V4.1.0 section 10 contents of the Elementary Files
    ELEMENTARY_FILE_ICCID = 0x2FE2,
    ELEMENTARY_FILE_OPL5G = 0x4F08,
    ELEMENTARY_FILE_IMG = 0x4F20,
    ELEMENTARY_FILE_HPLMN = 0x6F31,
    ELEMENTARY_FILE_SST = 0x6F38,
    ELEMENTARY_FILE_ADN = 0x6F3A,
    ELEMENTARY_FILE_FDN = 0x6F3B,
    ELEMENTARY_FILE_SMS = 0x6F3C,
    ELEMENTARY_FILE_GID1 = 0x6F3E,
    ELEMENTARY_FILE_GID2 = 0x6F3F,
    ELEMENTARY_FILE_MSISDN = 0x6F40,
    ELEMENTARY_FILE_SPN = 0x6F46,
    ELEMENTARY_FILE_SDN = 0x6F49,
    ELEMENTARY_FILE_EXT1 = 0x6F4A,
    ELEMENTARY_FILE_EXT2 = 0x6F4B,
    ELEMENTARY_FILE_EXT3 = 0x6F4C,
    ELEMENTARY_FILE_EXT4 = 0x6F4E,
    ELEMENTARY_FILE_PLMN_W_ACT = 0x6F60,
    ELEMENTARY_FILE_OPLMN_W_ACT = 0x6F61,
    ELEMENTARY_FILE_HPLMN_W_ACT = 0x6F62,
    ELEMENTARY_FILE_FPLMN = 0x6F7B,
    ELEMENTARY_FILE_AD = 0x6FAD,
    ELEMENTARY_FILE_PNN = 0x6FC5,
    ELEMENTARY_FILE_OPL = 0x6FC6,
    ELEMENTARY_FILE_MBDN = 0x6FC7,
    ELEMENTARY_FILE_EXT6 = 0x6FC8,
    ELEMENTARY_FILE_MBI = 0x6FC9,
    ELEMENTARY_FILE_MWIS = 0x6FCA,
    ELEMENTARY_FILE_CFIS = 0x6FCB,
    // 3GPP TS 31.102 V3.5.0 section 4.7 files of ADF USIM
    ELEMENTARY_FILE_PBR = 0x4F30,
    ELEMENTARY_FILE_LI = 0x6F05,
    // for usim extensiom
    ELEMENTARY_FILE_EXT5 = 0x6F4E,
    ELEMENTARY_FILE_SPDI = 0x6FCD,
    ELEMENTARY_FILE_EHPLMN = 0x6FD9,
    ELEMENTARY_FILE_LRPLMNSI = 0x6FDC,
    ELEMENTARY_FILE_HPPLMN = 0x6F31,
    ELEMENTARY_FILE_USIM_ADN = 0x4F3A,
    ELEMENTARY_FILE_USIM_IAP = 0x4F3B,
    // CDMA RUIM file ids from 3GPP2 C.S0023-0
    ELEMENTARY_FILE_CST = 0x6F32,
    ELEMENTARY_FILE_RUIM_SPN = 0x6F41,
    ELEMENTARY_FILE_CSIM_LI = 0x6F3A,
    ELEMENTARY_FILE_CSIM_SPN = 0x6F41,
    ELEMENTARY_FILE_CSIM_MDN = 0x6F44,
    ELEMENTARY_FILE_CSIM_IMSIM = 0x6F22,
    ELEMENTARY_FILE_CSIM_CDMAHOME = 0x6F28,
    ELEMENTARY_FILE_CSIM_EPRL = 0x6F5A,
    ELEMENTARY_FILE_CSIM_MIPUPP = 0x6F4D,
    // ISIM access
    ELEMENTARY_FILE_IMPU = 0x6F04,
    ELEMENTARY_FILE_IMPI = 0x6F02,
    ELEMENTARY_FILE_DOMAIN = 0x6F03,
    ELEMENTARY_FILE_IST = 0x6F07,
    ELEMENTARY_FILE_PCSCF = 0x6F09
};

// file controller constant
enum ControllerRequest {
    CONTROLLER_REQ_READ_BINARY = 0xb0,
    CONTROLLER_REQ_UPDATE_BINARY = 0xd6,
    CONTROLLER_REQ_READ_RECORD = 0xb2,
    CONTROLLER_REQ_UPDATE_RECORD = 0xdc,
    CONTROLLER_REQ_SEEK = 0xa2,
    CONTROLLER_REQ_GET_RESPONSE = 0xc0
};

enum ElementaryFileTile {
    ELEMENTARY_FILE_TYPE_TRANSPARENT = 0,
    ELEMENTARY_FILE_TYPE_LINEAR_FIXED = 1,
    ELEMENTARY_FILE_TYPE_CYCLIC = 3
};

enum MainFile {
    ICC_MASTER_FILE = 1,
    ICC_DEDICATED_FILE = 2,
    ICC_ELEMENTARY_FILE = 4
};

enum ResponseFile {
    GET_RESPONSE_ELEMENTARY_FILE_SIZE_BYTES = 15,
    GET_RESPONSE_ELEMENTARY_FILE_IMG_SIZE_BYTES = 10
};

// controller file type
enum SizeType {
    SIZE_ONE_OF_FILE = 2,
    SIZE_TWO_OF_FILE = 3,
    TYPE_OF_FILE = 6,
    STRUCTURE_OF_DATA = 13,
    LENGTH_OF_RECORD = 14
};

enum ControllerMessage {
    MSG_SIM_OBTAIN_SIZE_OF_FIXED_ELEMENTARY_FILE_DONE = 1,
    MSG_SIM_OBTAIN_FIXED_ELEMENTARY_FILE_DONE = 2,
    MSG_SIM_OBTAIN_SIZE_OF_TRANSPARENT_ELEMENTARY_FILE_DONE = 3,
    MSG_SIM_OBTAIN_TRANSPARENT_ELEMENTARY_FILE_DONE = 4,
    MSG_SIM_OBTAIN_SIZE_OF_LINEAR_ELEMENTARY_FILE_DONE = 5,
    MSG_SIM_UPDATE_TRANSPARENT_ELEMENTARY_FILE_DONE = 6,
    MSG_SIM_UPDATE_LINEAR_FIXED_FILE_DONE = 7,
    MSG_SIM_OBTAIN_INVALID_RECORD_OF_FIXED_ELEMENTARY_FILE_DONE = 8,
    MSG_SIM_OBTAIN_ICON_DONE = 10
};

enum {
    INVALID_VALUE = -1,
    BYTE_LENGTH = 8,
    BYTE_VALUE = 0xFF
};

enum LockMsg {
    MSG_SIM_LOCKED_RECORDS_LOADED = 0xf3,
    MSG_SIM_NETWORK_LOCKED_RECORDS_LOADED = 0xf4,
    MSG_SIM_SPN_UPDATED = 0xf5
};

enum SpnType { SPN_INVALID = -1, SPN_COND_PLMN = 1, SPN_COND = 2 };

enum SpnShowType {
    SPN_CONDITION_DISPLAY_SPN = 0x01,
    SPN_CONDITION_DISPLAY_PLMN = 0x02
};

enum ActiveState {
    DEACTIVE = 0,
    ACTIVE = 1
};

enum CardShape {
    ENTITY_CARD = 1,
    VIRTUAL_CARD = 11
};

enum CardStand {
    NOT_MAIN = 0,
    MAIN_CARD = 1
};

enum IccStatus {
    ICC_STATE_UNKNOWN = 0,
    ICC_STATE_NOT_READY = 1,
    ICC_STATE_ABSENT = 2,
    ICC_STATE_READY = 3,
    ICC_STATE_LOADED = 4,
    ICC_STATE_IMSI = 5,
    ICC_STATE_PIN = 6,
    ICC_STATE_PUK = 7,
    ICC_STATE_SIMLOCK = 8
};

enum IccDiallingNumberConstant {
    LOADER_ERROR = 200,
    PARAMETER_INCORRECT = 201,
    NAME_CHAR_POS = 36,
    CSIM_SPN_OCTET = 0x00,
    CSIM_SPN_7BIT_ASCII = 0x02,
    CSIM_SPN_IA5 = 0x03,
    CSIM_SPN_UNICODE_16 = 0x04,
    CSIM_SPN_LATIN = 0x08,
    CSIM_SPN_7BIT_ALPHABET = 0x09
};

enum RadioProtocolEvent {
    MSG_SIM_TIME_OUT_ACTIVE = 2000,
    MSG_SIM_SET_ACTIVE = 2001,
    MSG_SIM_FORGET_ALLDATA = 2002,
};

enum VoiceMailConstant {
    DEFAULT_VOICE_MAIL_COUNT = -2,
    UNKNOWN_VOICE_MAIL_COUNT = -1,
};

enum CallForwardingStatus {
    CALL_FORWARDING_STATUS_DISABLED = 0,
    CALL_FORWARDING_STATUS_ENABLED = 1,
    CALL_FORWARDING_STATUS_UNKNOWN = -1,
};

enum class UsimService {
    USIM_PHONEBOOK = 1,
    USIM_FDN, // Fixed Dialing Numbers
    USIM_FDN_EXTENSION,
    USIM_SDN,
    USIM_SDN_EXTENSION,
    USIM_BDN,
    USIM_BDN_EXTENSION,
    USIM_OUTGOING_CALL_INFO,
    USIM_INCOMING_CALL_INFO,
    USIM_SM_STORAGE,
    USIM_SM_STATUS_REPORTS,
    USIM_SM_SERVICE_PARAMS,
    USIM_ADVICE_OF_CHARGE,
    USIM_CAP_CONFIG_PARAMS_2,
    USIM_CB_MESSAGE_ID,
    USIM_CB_MESSAGE_ID_RANGES,
    USIM_GROUP_ID_LEVEL_1,
    USIM_GROUP_ID_LEVEL_2,
    USIM_SPN,
    USIM_USER_PLMN_SELECT,
    USIM_MSISDN,
    USIM_IMAGE,
    USIM_LOCALISED_SERVICE_AREAS,
    USIM_EMLPP,
    USIM_EMLPP_AUTO_ANSWER,
    USIM_RFU,
    USIM_GSM_ACCESS,
    USIM_DATA_DL_VIA_SMS_PP,
    USIM_DATA_DL_VIA_SMS_CB,
    USIM_CALL_CONTROL_BY_USIM,
    USIM_MO_SMS_CONTROL_BY_USIM,
    USIM_RUN_AT_COMMAND,
    USIM_IGNORED_1,
    USIM_ENABLED_SERVICE_TABLE,
    USIM_APN_CONTROL_LIST,
    USIM_DEPERSONALISATION_CONTROL_KEYS,
    USIM_COOPERATIVE_NETWORK_LIST,
    USIM_GSM_SECURITY_CONTEXT,
    USIM_CPBCCH_INFO,
    USIM_INVESTIGATION_SCAN,
    USIM_MEXE,
    USIM_OPERATOR_PLMN_SELECT,
    USIM_HPLMN_SELECT,
    USIM_EXTENSION_5,
    USIM_PLMN_NETWORK_NAME,
    USIM_OPERATOR_PLMN_LIST,
    USIM_MBDN,
    USIM_MWI_STATUS,
    USIM_CFI_STATUS,
    USIM_IGNORED_2,
    USIM_SERVICE_PROVIDER_DISPLAY_INFO,
    USIM_MMS_NOTIFICATION,
    USIM_MMS_NOTIFICATION_EXTENSION,
    USIM_GPRS_CALL_CONTROL_BY_USIM,
    USIM_MMS_CONNECTIVITY_PARAMS,
    USIM_NETWORK_INDICATION_OF_ALERTING,
    USIM_VGCS_GROUP_ID_LIST,
    USIM_VBS_GROUP_ID_LIST,
    USIM_PSEUDONYM,
    USIM_IWLAN_USER_PLMN_SELECT,
    USIM_IWLAN_OPERATOR_PLMN_SELECT,
    USIM_USER_WSID_LIST,
    USIM_OPERATOR_WSID_LIST,
    USIM_VGCS_SECURITY,
    USIM_VBS_SECURITY,
    USIM_WLAN_REAUTH_IDENTITY,
    USIM_MM_STORAGE,
    USIM_GBA,
    USIM_MBMS_SECURITY,
    USIM_DATA_DL_VIA_USSD,
    USIM_EQUIVALENT_HPLMN,
    USIM_TERMINAL_PROFILE_AFTER_UICC_ACTIVATION,
    USIM_EQUIVALENT_HPLMN_PRESENTATION,
    USIM_LAST_RPLMN_SELECTION_INDICATION,
    USIM_OMA_BCAST_PROFILE,
    USIM_GBA_LOCAL_KEY_ESTABLISHMENT,
    USIM_TERMINAL_APPLICATIONS,
    USIM_SPN_ICON,
    USIM_PLMN_NETWORK_NAME_ICON,
    USIM_IP_CONNECTION_PARAMS,
    USIM_IWLAN_HOME_ID_LIST,
    USIM_IWLAN_EQUIVALENT_HPLMN_PRESENTATION,
    USIM_IWLAN_HPLMN_PRIORITY_INDICATION,
    USIM_IWLAN_LAST_REGISTERED_PLMN,
    USIM_EPS_MOBILITY_MANAGEMENT_INFO,
    USIM_ALLOWED_CSG_LISTS_AND_INDICATIONS,
    USIM_CALL_CONTROL_ON_EPS_PDN_CONNECTION_BY_USIM,
    USIM_HPLMN_DIRECT_ACCESS,
    USIM_ECALL_DATA,
    USIM_OPERATOR_CSG_LISTS_AND_INDICATIONS,
    USIM_SM_OVER_IP,
    USIM_CSG_DISPLAY_CONTROL,
    USIM_IMS_COMMUNICATION_CONTROL_BY_USIM,
    USIM_EXTENDED_TERMINAL_APPLICATIONS,
    USIM_UICC_ACCESS_TO_IMS,
    USIM_NAS_CONFIG_BY_USIM,
    USIM_PWS_CONFIG_BY_USIM,
    USIM_RFU2,
    USIM_URI_SUPPORT_BY_UICC,
    USIM_EXTENDED_EARFCN_SUPPORT,
    USIM_PROSE,
    USIM_USAT_APPLICATION_PAIRING,
    USIM_MEDIA_TYPE_SUPPORT,
    USIM_IMS_CALL_DISCONNECTION_CAUSE,
    USIM_URI_SUPPORT_FOR_MO_SHORT_MSG_CTL,
    USIM_EPDG_CONFIG_INFO_FOR_SERVICE_SUPPORT,
    USIM_EPDG_CONFIG_INFO_FOR_SERVICE_CONFIGURED,
    USIM_ACDC_SUPPORT,
    USIM_MISSION_CTITICAL_SERVICES,
    USIM_EPDG_CONFIG_INFO_FOR_EMG_SERVICE_SUPPORT,
    USIM_EPDG_CONFIG_INFO_FOR_EMG_SERVICE_CONFIGURED,
    USIM_ECALL_DATA_OVER_MIS,
    USIM_URI_SUPPORTED_FOR_SMS_PP_DOWNLOAD,
    USIM_FROM_PREFERRED,
    USIM_IMS_CONFIG_DATA,
    USIM_TV_CONFIG,
    USIM_FOR_3GPP_PS_DATA_OFF,
    USIM_FOR_3GPP_PS_DATA_OFF_SERVICE_LIST,
    USIM_V2X,
    USIM_XCAP_CONFIG_DATA,
    USIM_EARFCN_LIST_FOR_MTC_OR_NB_LOT_UES,
    USIM_FOR_5GS_MOBILITY_MANAGEMENT_INFO,
    USIM_FOR_5G_SECURITY_PARAMETERS,
    USIM_SUBSCRIPTION_IDENTIFIER_PRIVACY_SUPPORT,
    USIM_SUCI_CALCULATION_BY_THE_USIM,
    USIM_UAC_ACCESS_IDENTITIES_SUPPORT,
    USIM_CTRL_PLANE_BASED_STEERING_OF_UE_IN_VPLMN,
    USIM_CALL_CTRL_ON_PDU_SESSION_BY_USIM,
    USIM_FOR_5GS_OPERATOR_PLMN_LIST,
    USIM_SUPPORT_FOR_SUPI_OF_TYPE_NET_SPEC_IDENTIFIER,
    USIM_FOR_3GPP_PS_DATA_OFF_SEPARATE_HOME_AND_ROAMING_LISTS,
    USIM_SUPPORT_FOR_URSP_BY_USIM,
    USIM_FOR_5G_SECURITY_PARAMETERS_EXTENDED,
};

} // namespace Telephony
} // namespace OHOS
#endif // OHOS_SIM_CONSTANT_H
